﻿#include <iostream>
#include <vector>
#include "Token.h"
#include "SyntaxAnalysis.h"
using namespace std;

void getTokenVector(vector<Token> &vec) {
	char buffer[6666];
	FILE* in = fopen("testfile.txt", "r");
	freopen("output.txt", "w", stdout);
	//FILE* in = fopen("mytest.txt", "r");
	int i = 0;
	while ((buffer[i] = fgetc(in)) != EOF) {

		//putchar(buffer[i]);
		i++;
	}
	buffer[i] = 0;
	char* ch = buffer;
	Token token;
	while (token.init(ch)) {
		vec.push_back(token);
	}
}
int main()
{
	/*Token token1, token2;
	char ch1[] = "123", ch2[] = "123";
	char* ch3 = ch1, * ch4 = ch2;
	token1.init(ch4);
	token2.init(ch3);
	cout << (token1 < token2);
	return 0;*/
	vector<Token> tokenVector;
	getTokenVector(tokenVector);
	SynMain(tokenVector);
}